package org.spruice;

import java.io.IOException;
import java.net.URL;
import java.util.Properties;

public class PropertiesResource {

    public static Properties load(String name) {
        URL u = Thread.currentThread().getContextClassLoader().getResource(name);
        if (u == null) throw new RuntimeException("Not Found: " + name);
        Properties p = new Properties();
        try {
            p.load(u.openStream());
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
        return p;
    }
}
